<template>
    <div class="agentPay" v-loading="loading">
        <merchantNum class="merchant-num" />
        <agentPayForm class="agent-pay-form" />
        <plainTable :tableData="tableData" :tableConfigData="tableConfigData" :pageInfo="pageInfo" tableTitle="代付紀錄"
            @prevPage="prevPage" @nextPage="nextPage" />
    </div>
</template>

<script setup>
import merchantNum from '@/components/merchantNum.vue'
import agentPayForm from '@/components/agentPayForm.vue'
import plainTable from '@/components/plainTable.vue'
import { useAgentPay } from '@/hooks/account';

const { prevPage, nextPage,loading, tableData, tableConfigData, pageInfo } = useAgentPay();

// const prevPage = () => {
//     if (pageInfo.value.currentPage === 1) {
//         return;
//     }
//     pageInfo.value.currentPage--;
//     initData(pageInfo.value.currentPage);
// }


// const nextPage = () => {
//     if (pageInfo.value.currentPage === pageInfo.value.totalPage) {
//         return;
//     }
//     pageInfo.value.currentPage++;
//     initData(pageInfo.value.currentPage);
// }

</script>
<style scoped lang="scss">
.agentPay {
    .merchant-num {
        margin-bottom: 10px;
    }

    .agent-pay-form {
        margin-bottom: 5px;
    }
}
</style>